<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</head>

<body>
  <ul class="nav nav-pills mb-3" id="pills-tab">
    <li class="nav-item">
      <a class="nav-link active" id="pills-mzb-tab" href="#?type=1">民政部登记</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" id="pills-loc-tab" href="#?type=2">地方登记</a>
    </li>
  </ul>
</body>
<script>
  $("#pills-loc-tab").click(function () {
    $(this).addClass("active");
    $("#pills-mzb-tab").removeClass("active");
  });
 $("#pills-mzb-tab").click(function () {
    $(this).addClass("active");
    $("#pills-loc-tab").removeClass("active");
  });
  
</script>

</html>